<!DOCTYPE html>
<html>
	<head>
	<title>日常</title>
		<meta http-equiv="Pragma" CONTENT="no-cache">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="renderer" content="webkit">

		<%include("/common/include.html"){}%>
		
	</head>
	<body>	
		<div id="cpgm"   class="easyui-layout" style="width:100%;height:100%;">
			<input id="ymtype" type="hidden" value="${ymtype!}">
			<form id="daily">
				<div data-options="region:'north'" style="height:65px;">
					<div class="charge">
						<ul class="headContent">
							<li style="margin-top: 14px;margin-left:24px;">
								<div>
									日期:
									<input name="customerHabit.gxsj" id="arrivedMinDate"  value = ${date!} class="easyui-datebox theme-textbox-radius" 
										data-options="sharedCalendar:'#cc'"/>
								</div>
							</li>
							<div id="cc" class="easyui-calendar "></div>	
							<li style="margin-top: 14px;margin-left:24px;">
								<div>
									<span>姓名</span> 
									<input id="customerIds" name="customerHabit.customerID"  type="hidden"  value="${customer.ids !}">
									<input class="easyui-combobox" name="language" style="width:120px;height:32px;"  id="customerName" name="customer.name"  value="${customer.name !}"  
								data-options="
								url:'bentryRegister/getCusInfo',
								method:'post',
								valueField:'name',
								textField:'name'
								">
								</div>
							</li>
							<li style="margin-left: 30px;">
								<div>
									<span>手机号</span>
								<input class="easyui-combobox" name="language" style="width:120px;height:32px;"  id="customerPhone" name="customer.phone"  value="${customer.phone !}"  
								data-options="
								url:'bentryRegister/getCusInfo',
								method:'post',
								valueField:'phone',
								textField:'phone'
								">
								</div>
							</li>
							<li style="margin-left: 30px;">
								<div>
									<span>会员编号</span>
									<input class="easyui-combobox" name="language" style="width:120px;height:32px;"  id="customerHybh" name="customer.hybh"  value="${customer.hybh !}"  
								data-options="
								url:'bentryRegister/getCusInfo',
								method:'post',
								valueField:'hybh',
								textField:'hybh'
								">
								</div>
							</li>
							<li style="margin-left: 0px;">
								<div>
									<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear'" style="width:80px"  onclick="clearsj()">清除</a>
									<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" style="width:80px"  onclick="getEveryDay()">保存</a>
								</div>
							</li>
						</ul>
					</div>	
				</div>
			<div data-options="region:'center'" style="OVERFLOW-X:hidden;">
				<div style="height: 150px;width: 800px;margin: -5px auto 0;" class="lifeItem">
					<div style="width: 40px;height: 100%;display: inline-block;position: relative;"></div>
						<div style="display: inline-block;">
							<div style="margin: 0 auto;width: 700px;">
								<div class="easyui-panel" title="早餐" style="width:800px;height:145px;padding:10px;margin-bottom: -1px;">
									<ul>
										<li>
											<span>时间</span>
											<#baseInfo type="select_2" id="breakfasttime_select" name="customerHabit.breakfasttime" baseinfo="baseinfo_breakfasttime" defaultCode="${customerHabit.breakfasttime! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										</li>
										<li style="margin-top: 5px;">
											<span>内容</span>
											<#baseInfo type="select_2" id="breakfast_select" name="customerHabit.breakfast" baseinfo="baseinfo_breakfast" defaultCode="${customerHabit.breakfast! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
											<span style="margin-left: 120px;">量</span>
											<#baseInfo type="select_2" id="breakfastamount_select" name="customerHabit.breakfastamount" baseinfo="baseinfo_breakfastamount" defaultCode="${customerHabit.breakfastamount! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
											<span style="margin-left: 120px;">速度</span>
											<#baseInfo type="select_2" id="breakfastamount_select" name="customerHabit.breakfastSpeed" baseinfo="baseinfo_breakfastSpeed" defaultCode="${customerHabit.breakfastSpeed! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										</li>
										<li style="margin-top: 5px;">
											<span >饮水</span>
											<#baseInfo type="select_2" id="breakfastSpeed_select" name="customerHabit.breakfastwater" baseinfo="baseinfo_breakfastwater" defaultCode="${customerHabit.breakfastwater! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
											<span style="margin-left: 108px;">建议</span>
											<input name="customerHabit.breakfastAdvise" class="easyui-textbox theme-textbox-radius" style="height: 25px;width: 120px;" value="${customerHabit.breakfastAdvise! }">
										</li>
									</ul>
								</div>
								<div class="easyui-panel" title="午餐" style="width:800px;height:145px;padding:10px;margin-bottom: -1px;">
									<ul>
										<li>
											<span>时间</span>
											<#baseInfo type="select_2" id="lunchtime_select" name="customerHabit.lunchtime" baseinfo="baseinfo_lunchtime" defaultCode="${customerHabit.lunchtime! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										</li>
										<li style="margin-top: 5px;">
											<span>内容</span>
											<#baseInfo type="select_2" id="lunch_select" name="customerHabit.lunch" baseinfo="baseinfo_lunch" defaultCode="${customerHabit.lunch! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
											<span style="margin-left: 120px;">量</span>
											<#baseInfo type="select_2" id="lunchamount_select" name="customerHabit.lunchamount" baseinfo="baseinfo_lunchamount" defaultCode="${customerHabit.lunchamount! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
											<span style="margin-left: 120px;">速度</span>
											<#baseInfo type="select_2" id="lunchSpeed_select" name="customerHabit.lunchSpeed" baseinfo="baseinfo_lunchSpeed" defaultCode="${customerHabit.lunchSpeed! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										</li>
										<li style="margin-top: 5px;">
											<span >饮水</span>
											<#baseInfo type="select_2" id="lunchwater_select" name="customerHabit.lunchwater" baseinfo="baseinfo_lunchwater" defaultCode="${customerHabit.lunchwater! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
											<span style="margin-left: 108px;">建议</span>
											<input name="customerHabit.lunchAdvise" class="easyui-textbox theme-textbox-radius" style="height: 25px;width: 120px;"  value="${customerHabit.lunchAdvise !}">
										</li>
									</ul>
								</div>
							<div class="easyui-panel" title="晚餐" style="width:800px;height:145px;padding:10px;margin-bottom: -1px;">
								<ul>
									<li>
										<span>时间</span>
										<#baseInfo type="select_2" id="dinnertime_select" name="customerHabit.dinnertime" baseinfo="baseinfo_dinnertime" defaultCode="${customerHabit.dinnertime! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
									</li>
									<li style="margin-top: 5px;">
										<span>内容</span>
										<#baseInfo type="select_2" id="dinner_select" name="customerHabit.dinner" baseinfo="baseinfo_dinner" defaultCode="${customerHabit.dinner! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										<span style="margin-left: 120px;">量</span>
										<#baseInfo type="select_2" id="dinneramount_select" name="customerHabit.dinneramount" baseinfo="baseinfo_dinneramount" defaultCode="${customerHabit.dinneramount! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										<span style="margin-left: 120px;">速度</span>
										<#baseInfo type="select_2" id="dinnerSpeed_select" name="customerHabit.dinnerSpeed" baseinfo="baseinfo_dinnerSpeed" defaultCode="${customerHabit.dinnerSpeed! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
									</li>
									<li style="margin-top: 5px;">
									<span >饮水</span>
										<#baseInfo type="select_2" id="dinnerwater_select" name="customerHabit.dinnerwater" baseinfo="baseinfo_dinnerwater" defaultCode="${customerHabit.dinnerwater! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										<span style="margin-left: 108px;">建议</span>
										<input name="customerHabit.dinnerAdvise"  class="easyui-textbox theme-textbox-radius" style="height: 25px;width: 120px;" value="${customerHabit.dinnerAdvise !}">
									</li>
								</ul>
							</div>
							<div class="easyui-panel" title="作息" style="width:800px;height:150px;padding:10px;margin-bottom: -1px;">
								<ul>
									<li style="margin-top: 5px;">
										<span>早起</span>
										<#baseInfo type="select_2" id="morning_select" name="customerHabit.morning" baseinfo="baseinfo_morning" defaultCode="${customerHabit.morning! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										<span style="margin-left: 120px;">建议</span>
										<input name="customerHabit.morningAdvise" class="easyui-textbox theme-textbox-radius" style="height: 25px;width: 200px;" value="${customerHabit.morningAdvise !}">
									</li>
									<li style="margin-top: 5px;">
										<span>午休</span>
										<#baseInfo type="select_2" id="noonbreak_select" name="customerHabit.noonbreak" baseinfo="baseinfo_noonbreak" defaultCode="${customerHabit.noonbreak! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										<span style="margin-left: 120px;">建议</span>
										<input name="customerHabit.noonbreakAdvise" class="easyui-textbox theme-textbox-radius" style="height: 25px;width: 200px;" value="${customerHabit.noonbreakAdvise !}">
									</li>
									<li style="margin-top: 5px;">
										<span>晚休</span>
										<#baseInfo type="select_2" id="nighttime_select" name="customerHabit.nighttime" baseinfo="baseinfo_nighttime" defaultCode="${customerHabit.nighttime! }"  class="easyui-combobox inputBox theme-textbox-radius" style="height: 25px;width: 120px;"/>
										<span style="margin-left: 120px;">建议</span>
										<input name="customerHabit.nighttimeAdvise" class="easyui-textbox theme-textbox-radius" style="height: 25px;width: 200px;"  value="${customerHabit.nighttimeAdvise !}">
									</li>
								</ul>
							</div>
							<div class="easyui-panel" title="其他" style="width:800px;height:150px;padding:10px;">
								<ul>
									<li style="margin-top: 5px;">
										<span>零食</span>
										<input id="snacks" type="hidden"  value="${customerHabit.snacks !}">
										<select id="snacks_select" name="customerHabit.snacks" class="easyui-combobox theme-textbox-radius" style="height: 25px;width:80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
										<span style="margin-left:60px;">水果</span>
										<input id="fruits" type="hidden"  value="${customerHabit.fruits !}">
										<select id="fruits_select"  name="customerHabit.fruits" class="easyui-combobox theme-textbox-radius" style="height: 25px;width:80px;"  value="${customerHabit.fruits !}">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
										<span style="margin-left: 60px;">应酬</span>
										<input id="greetings" type="hidden"  value="${customerHabit.greetings !}">
										<select id="greetings_select" name="customerHabit.greetings" class="easyui-combobox theme-textbox-radius" style="height: 25px;width: 80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
										<span style="margin-left:60px;">饮酒</span>
										<input id="drink" type="hidden"  value="${customerHabit.drink !}">
										<select id="drink_select" name="customerHabit.drink" class="easyui-combobox theme-textbox-radius" style="height: 25px;width:80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
									</li>
									<li style="margin-top: 5px;">
										<span>运动</span>
										<input id="sports" type="hidden"  value="${customerHabit.sports !}">
										<select id="sports_select" name="customerHabit.sports" class="easyui-combobox theme-textbox-radius" style="height: 25px;width: 80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
										<span style="margin-left: 60px;">便秘</span>
										<input id="astriction" type="hidden"  value="${customerHabit.astriction !}">
										<select  id="astriction_select" name="customerHabit.astriction" class="easyui-combobox theme-textbox-radius" style="height: 25px;width: 80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
										<span style="margin-left:60px;">情绪</span>
										<input id="mood" type="hidden"  value="${customerHabit.mood !}">
										<select id="mood_select" name="customerHabit.mood" class="easyui-combobox theme-textbox-radius" style="height: 25px;width: 80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
										<span style="margin-left: 48px;">生理期</span>
										<input id="menstrualperiod" type="hidden"  value="${customerHabit.menstrualperiod !}">
										<select id="menstrualperiod_select" name="customerHabit.menstrualperiod" class="easyui-combobox theme-textbox-radius" style="height: 25px;width: 80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
									</li>
									<li style="margin-top: 5px;">
										<span>疾病</span>
										<input id="ailment" type="hidden"  value="${customerHabit.ailment !}">
										<select id="ailment_select" name="customerHabit.ailment" class="easyui-combobox theme-textbox-radius" style="height: 25px;width: 80px;">
											<option value="0">无</option>
											<option value="1">有</option>
										</select>
										<span style="margin-left: 60px;">建议</span>
										<input name="customerHabit.otherAdvice" class="easyui-textbox theme-textbox-radius" style="height: 25px;width: 252px;" value="${customerHabit.otherAdvice !}">
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</form>	
		<script type="text/javascript">
			function  getCusInfo(){
				var hybh=$('#customerHybh').val();
				var name=$('#customerName').val();
				var phone=$('#customerPhone').val();
				
				if(hybh==''&&name==''&&phone==''){
					return false;
				}
				var url='/bentryRegister/getCusByHybh';
				var data={"hybh":hybh,"name":name,"phone":phone};
				var reData = common_ajax.ajaxFunc(url,data,"json");
				if(reData.msg==200)
				{
					$("#customerIds").val(reData.customer.ids);
					$("#customerName").textbox('setValue',reData.customer.name);
					$("#customerPhone").textbox('setValue',reData.customer.phone);
					$("#customerHybh").textbox('setValue',reData.customer.hybh);
					if(reData.customerDetail.productno!= null && reData.customerDetail.productno!= ""){
					$("#cpbh").textbox('setValue',reData.customerDetail.productno);
					$('#cpbh').textbox('textbox').attr('readonly',true);
					}
					searchInfo();
				}else
				{
					$.alert(parent.$, reData.msg);
				}
				return  reData;
				
			}
			
		</script>			
	<script type="text/javascript">
	function getEveryDay(){
		if($("#customerIds").val()==null||$("#customerIds").val()==""){
			$.alert(parent.$, "顾客不可为空！");
			return false;
		}
		var url='/binShopService/saveDaily';
		var data=$('#daily').serialize();
		var reData= common_ajax.ajaxFunc(url,data,'json');
		if(reData.status == "200"){
			$.slideMsg("保存成功", parent.$);
			location.reload();
		}else{
			$.messager.alert('餐饮日常','保存失败','error');
		}
	}
</script>		
			</div>
		</div>
		<script src="sb/js/buyProduct/buyProduct.js" type="text/javascript" charset="utf-8"></script>
	</body>
</html>
